<?php

// No direct access

defined('_JEXEC') or die('Restricted access');

//add javascript
$js1 = JURI::base().'components/com_restoran/assets/js/mootools.js';
$js2 = JURI::base().'components/com_restoran/assets/js/moodalbox.js';
$js3 = JURI::base().'components/com_restoran/assets/js/livevalidation.js';

$document 	=& JFactory::getDocument();	
$document->addScript('components/com_restoran/assets/js/livevalidation.js');

//add css
$css1 = JURI::base().'components/com_restoran/assets/css/moodalbox.css';
$css2 = JURI::base().'components/com_restoran/assets/css/common.css';

?>

<script type="text/javascript" src="<?echo $js1 ?>"></script>
<script type="text/javascript" src="<?echo $js2 ?>"></script>
<link rel="stylesheet" href=<?echo $css1 ?> type="text/css" media="screen" />
<link rel="stylesheet" href=<?echo $css2 ?> type="text/css" media="screen" />


<form action="index.php?option=com_restoran&view=restoran" method="post" name="adminForm" id="adminForm">
<fieldset class="adminform">
<legend>Cari Restoran</legend>
<table class="admintable">

<tr>
<td>
Masukkan Inputan :
</td>
<td width="100" align="right" class="key">
<input name="field_cari" type="text" class="input" id="field_cari" />
        <script type="text/javascript">
            var field_cari = new LiveValidation('field_cari');
            field_cari.add( Validate.Presence ,{ failureMessage: "Harus Diisi..!!" });
        </script>


</td>

<td>
<input name="cari" type="submit" value="cari" class="button" />
</td>
</tr>
</table>

<?php

    if ($_POST[field_cari]&&!empty($this->xml[1][nama_rest])){
echo "hasil pencarian restauran di <strong>$_POST[field_cari]</strong>";
echo "<br/>";
?>
<div class="result">
<fieldset>
    <legend>Restoran</legend>

<table border="0">
  <tr>
    <td colspan="6"><strong><?echo $this->xml[1][nama_rest];?></strong></td>
  </tr>
  <tr>
    <td colspan="6"><strong><?echo $this->xml[1][alamat_rest];?></strong></td>
  </tr>
  <tr>
    <td colspan="6"><strong><?echo $this->xml[1][telp_rest];?></strong></td>
  </tr>
  <tr>
    <td colspan="6"><strong><?echo $this->xml[1][website_rest];?></strong></td>
  </tr>
  <tr>
    <td colspan="3" align="center"><strong><u>MAKANAN</u></strong></td>
    <td colspan="3" align="center"><strong><u>MINUMAN</u></strong></td>
  </tr>
  <tr>
    <td colspan="1" width="317"><?echo $this->xml[1][makanan_1];?></td>
	<td width="38">Rp</td>
    <td width="105"><?echo $this->xml[1][harga_makanan_1 ];?></td>
    <td width="330"><?echo $this->xml[1][minuman_1];?></td>
	<td width="42">Rp</td>
    <td width="113"><?echo $this->xml[1][harga_minuman_1 ];?></td>
  </tr>
  <tr>
    <td width="317"><?echo $this->xml[1][makanan_2];?></td>
	<td width="38">Rp</td>
    <td><?echo $this->xml[1][harga_makanan_2 ];?></td>
    <td><?echo $this->xml[1][minuman_2];?></td>
	<td width="42">Rp</td>
    <td><?echo $this->xml[1][harga_minuman_2 ];?></td>
  </tr>
  <tr>
    <td width="317"><?echo $this->xml[1][makanan_3];?></td>
	<td width="38">Rp</td>
    <td><?echo $this->xml[1][harga_makanan_3 ];?></td>
    <td><?echo $this->xml[1][minuman_3];?></td>
	<td width="42">Rp</td>
    <td><?echo $this->xml[1][harga_minuman_3 ];?></td>
  </tr>
  <tr>
    <td width="317"><?echo $this->xml[1][makanan_4];?></td>
	<td width="38">Rp</td>
    <td><?echo $this->xml[1][harga_makanan_4];?></td>
    <td><?echo $this->xml[1][minuman_4];?></td>
	<td width="42">Rp</td>
    <td><?echo $this->xml[1][harga_minuman_4 ];?></td>
  </tr>
  <tr>
    <td width="317"><?echo $this->xml[1][makanan_5];?></td>
	<td width="38">Rp</td>
    <td><?echo $this->xml[1][harga_makanan_5];?></td>
    <td><?echo $this->xml[1][minuman_5];?></td>
	<td width="42">Rp</td>
    <td><?echo $this->xml[1][harga_minuman_5 ];?></td>
  </tr>
  <tr>
      <td colspan="6" align="right">
      <a href="index.php?option=com_restoran&view=all&input=<?echo $_POST[field_cari]?>" rel="moodalbox 900 500" title="<?echo $_POST[field_cari]?>">selengkapnya</a>
      </td>
  </tr>
</table>
</fieldset>
</div>
<?
    }// end of if

else if ($_POST[field_cari]&&empty($this->xml[1][nama_rest])) {
    echo "Hasil Pencarian Terhadap <strong>$_POST[field_cari]</strong> Tidak Menemukan Hasil";
    }
?>
</fieldset>
</form>